package com.apifamily.Utils;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

/**
 * 签名工具
 */
public class SignUtil {

    /**
     * 签名生成算法
     * @return
     */
    public static String getSign(String body, String secretKey) {
        Digester SHA256 = new Digester(DigestAlgorithm.SHA256);

        String content = body +"."+ secretKey;
        // 5393554e94bf0eb6436f240a4fd71282
        String digestHex = SHA256.digestHex(content);
        return digestHex;
    }
}
